package com.agileboot.attendance.common.enums;

import com.agileboot.common.enums.BasicEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 结算单状态枚举
 */
@Getter
@AllArgsConstructor
public enum SettlementStatusEnum implements BasicEnum<String> {
    
    /**
     * 待供应商确认
     */
    PENDING_SUPPLIER_CONFIRM("0", "待供应商确认"),

    /**
     * 供应商已确认
     */
    SUPPLIER_CONFIRMED("1", "供应商已确认"),

    /**
     * 已完成
     */
    COMPLETED("2", "已完成"),

    /**
     * 已取消
     */
    CANCELLED("3", "已取消");

    private final String value;
    private final String description;

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String description() {
        return this.description;
    }

    /**
     * 根据值获取枚举
     */
    public static SettlementStatusEnum fromValue(String value) {
        for (SettlementStatusEnum status : values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        return null;
    }

    /**
     * 根据值获取描述
     */
    public static String getDescriptionByValue(String value) {
        SettlementStatusEnum status = fromValue(value);
        return status != null ? status.description() : "";
    }
} 